/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-06-07
 * Time: 11:05
 */
public class TestDemo {
    public static void main(String[] args) {
        int[] array = {8,1,5,4,3,2,7,6,10,9};
        binarySearchTree binarySearchTree = new binarySearchTree();
        for (int i = 0; i < array.length; i++) {
            binarySearchTree.insert(array[i]);
        }

        binarySearchTree.inOder(binarySearchTree.root);
        System.out.println();
        binarySearchTree.remove(9);
        binarySearchTree.inOder(binarySearchTree.root);
        binarySearchTree.TreeNode node = binarySearchTree.search(7);
        System.out.println();
        System.out.println(node.key);
    }
}
